
<div id="dialog-confirm" title="Delete post" style="display:none;">
    <p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>Are you sure?</p>
</div>

<div class="left">

    <div class="banner">
        <div class="title">My Event</div>
    </div><!--banner-->       
    <div class="list-pro">
	<?php
	$this->widget('bootstrap.widgets.TbListView', array(
	    'dataProvider' => $dataProvider,
	    'itemView' => '_view',
	    'itemsTagName' => 'ul'
	));
	?>
    </div><!--list-pro-->

</div><!--left-->


<div class="right">    
    <?php $this->widget('application.widgets.Calendar'); ?>    
    <?php $this->widget('application.widgets.EventCalendar') ?>
</div><!--right-->
<script>
    $(document).ready(function() {
	$("#dialog-confirm").dialog({
	    autoOpen: false,
	    show: {
		effect: "bounce",
		duration: 1000
	    },
	    hide: {
		effect: "explode",
		duration: 1000
	    }
	});
	$('.delete-ads').click(function() {
	    var eventId = $(this).attr('event-id');
	    $("#dialog-confirm").dialog({
		buttons: {
		    "Yes": function() {

			$.post('<?php echo SITE_NAME_URL ?>/user/my_event/delete_event/', {eventId: eventId}, function(response) {
			    location.reload();
			});
			//$(this).dialog("close");

		    },
		    Cancel: function() {
			$(this).dialog("close");
		    }
		},
		modal: true

	    });
	    $("#dialog-confirm").dialog("open");
	});
    });
</script>
